<?php
error_reporting(E_ALL);
ini_set('include_path', '.:/home/bpedro/pear/lib/php:/usr/local/php5/lib/php');

require_once 'Delicioso.php';

$username = 'deliblog';
$password = 'deliblog';
$url = 'http://remix.wevel.com/delicioso/';
$dlc =& new Delicioso($username, $password, $url);

if (!empty($_GET['id'])) {
    $posts = $dlc->getPost($_GET['id']);
} else {
    $posts = $dlc->getPosts();
}
?>
<html>
<body>
<?php foreach ($posts as $post) { ?>
<h2><a href="<?php echo $post['href']; ?>"><?php echo stripslashes($post['description']); ?></a></h2>
<p>
<?php echo stripslashes($post['extended']); ?>
</p>
<em>posted by <a href="http://del.icio.us/<?php echo $username; ?>"><?php echo $username; ?></a>
on <?php echo date('r', strtotime($post['time'])); ?>.</em>
<?php list(, $id) = explode(':', $post['tag'][2]); ?>
<a href="post.php?id=<?php echo $id; ?>">Edit</a>
<hr />
<?php } ?>
</body>
</html>
